package com.itheima.execption;

import com.itheima.entity.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class ExecptionControlerAdvice {

    @ExceptionHandler(Exception.class)
    public Result ex1(Exception ex){
      log.error("出现了Exception异常");
      ex.printStackTrace();
      return new Result(false,"服务器繁忙,请稍后再试...");
    }

}
